UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7Z7+4UetRQKbwoBDBsLTYOTc7YKA7Q0pXYhp0YDaR2M='
WHERE
key_id = '7228f1c03c8f1ee8c69cbeff460ee06f741c7d04b65735958180ccfa81b522ce'
AND (
token = '7Z7+4UetRQKbwoBDBsLTYOTc7YKA7Q0pXYhp0YDaR2M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)