UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wkDHrVHUroN91OqUeTXpfh9CwrLPc5UqxILlniqcMa8='
WHERE
key_id = 'b19aa72733ebd122bab9ae856a5888859cf3068b88a4a0a2bf560c2ca7beed51'
AND (
token = 'wkDHrVHUroN91OqUeTXpfh9CwrLPc5UqxILlniqcMa8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)