UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1aa/Rjeh1gozhBsVK/yUyALrsy7iDqVgWtDVCHqDTq8='
WHERE
key_id = 'b4a18bfc544b7608944cfbcb2aa08f2a5bd1496a282ba3c5a7b0e5b61e2cf603'
AND (
token = '1aa/Rjeh1gozhBsVK/yUyALrsy7iDqVgWtDVCHqDTq8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)