UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TQSTeislr0dzXGyOz3DxnsruDNjMpR/FjVZi2G9zPwo='
WHERE
key_id = '90ed1798a2aa6551104e413442a07dbcbe47903a98a0b09ce9c10799bc377da3'
AND (
token = 'TQSTeislr0dzXGyOz3DxnsruDNjMpR/FjVZi2G9zPwo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)