UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gySqpWoBX3RRxSPuHZiLIxws3Hg+WCPbF5KN5UylnTI='
WHERE
key_id = 'e62286dce97743110db0af94d1e36c4893e8b0a6554c2197a79566c0ca8eeabc'
AND (
token = 'gySqpWoBX3RRxSPuHZiLIxws3Hg+WCPbF5KN5UylnTI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)