UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iwBMotWNGyJjCFWpYdnlEu8g+YeOJsdA09OSESHl2y4='
WHERE
key_id = '4df534dc6d3cd2273bfa8325cc11345692fb663b5d8f9401f639a75afa739850'
AND (
token = 'iwBMotWNGyJjCFWpYdnlEu8g+YeOJsdA09OSESHl2y4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)