UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ViuB29uQoYFKde9u0hv6cMlxM9PPDm1q6dRim/qPnwg='
WHERE
key_id = '6fe06fddd7e2348753bb60ea82df447186af7dab2e4354b910d8723acd9a3062'
AND (
token = 'ViuB29uQoYFKde9u0hv6cMlxM9PPDm1q6dRim/qPnwg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)