UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'edldeGOYB4E+wRNVDHmOF2LaQ3oKqITMfbs+KzcPSyU='
WHERE
key_id = 'df5c6392841294146ec6dc30acb7944d24b35641c5d93d472ee923565b7a0f49'
AND (
token = 'edldeGOYB4E+wRNVDHmOF2LaQ3oKqITMfbs+KzcPSyU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)