UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3mbYF3/SAMACj2TIHvI8bCmrvVEv2JSlrf4mxGXYQyg='
WHERE
key_id = '55f35ba0d1c0fcb320c4889f640f17b2bf1c990c28b29583a70b415ee3612b85'
AND (
token = '3mbYF3/SAMACj2TIHvI8bCmrvVEv2JSlrf4mxGXYQyg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)