UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OfU7TtiX4PZCy1NT0O/2GMw1EdpoSj7PQZNlUn18T7c='
WHERE
key_id = '5e02a22ddcae15acbfe910f8c1de5fe6b5cc4e05c61cedf9692d0a2f75158383'
AND (
token = 'OfU7TtiX4PZCy1NT0O/2GMw1EdpoSj7PQZNlUn18T7c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)