UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'saATW197og5phgWkjb7yAI7Ai13eQI/ih2ahl346SPI='
WHERE
key_id = 'fb86f3c14b71d421482eacfd4c3c9a1295de0fc4bbe6d050eb960f2c73b8fb4b'
AND (
token = 'saATW197og5phgWkjb7yAI7Ai13eQI/ih2ahl346SPI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)