UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '53R5fLMbzI7Sq+PiTG+dFGvhMqeOPBs+ZeHLEQrKpMU='
WHERE
key_id = '35881745ef016e759d73118c6ec43fef1b892f863048d629c80acaea5181653e'
AND (
token = '53R5fLMbzI7Sq+PiTG+dFGvhMqeOPBs+ZeHLEQrKpMU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)