UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9BoEBbzaQvsJmImzD65s+AbYi7HCDqWyJRXLgjYi4l4='
WHERE
key_id = 'd3b5349021a4a7896d09c24c05d5be9d934c59dd8dd934b9aa137ffb516f95ee'
AND (
token = '9BoEBbzaQvsJmImzD65s+AbYi7HCDqWyJRXLgjYi4l4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)