UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '78ytLyui/T+2bt27VYc0xhK6EA4kjACttd9ODu5RHLw='
WHERE
key_id = 'c80aaec154eb0585b4031953050e07818796c99d4ff683bb8b39d45ed672458f'
AND (
token = '78ytLyui/T+2bt27VYc0xhK6EA4kjACttd9ODu5RHLw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)