UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JSkD4HqUvCZHAtzoq4wINS9V9tDndHyjeWNVDh5DiTM='
WHERE
key_id = '7045015af8d3da9f83da7cacdf9f331ae017c5de2d6718b61bbe61eaa44d2ca2'
AND (
token = 'JSkD4HqUvCZHAtzoq4wINS9V9tDndHyjeWNVDh5DiTM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)