UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DALJLONGfsWbLDt9m8286Yjv9rZaJkLk5nww4azMO0I='
WHERE
key_id = '5c90a197468bfdfea1fc26c786c2f021532656cdf9ed7c6fc6d857420a6f57a2'
AND (
token = 'DALJLONGfsWbLDt9m8286Yjv9rZaJkLk5nww4azMO0I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)