UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5H+NvuWe3Pnf8XTE3VCmzo0P/sPyyOhinI6jWOF7Mbk='
WHERE
key_id = '8548628566693082da115dcdc52e3c45b198394cba0febe50fca20dc8fe203a6'
AND (
token = '5H+NvuWe3Pnf8XTE3VCmzo0P/sPyyOhinI6jWOF7Mbk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)