UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iNojzyarXI1jGtud9/UMk0LjpVhslZCDkGIDl71CDR8='
WHERE
key_id = '04685eb5488c21f0fde98f5fab41a7db260fd3f1cb3b87cf8ccc29977e48db7e'
AND (
token = 'iNojzyarXI1jGtud9/UMk0LjpVhslZCDkGIDl71CDR8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)