UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IT6ClyDoBWI2WIdb56c7tJ6ZQ/JBLty5YV+EUAtbH7s=' 
WHERE 
  key_id = '42c076339ecf150d5e9163ef88d6a27d57bfce8981f076f1c3595da1107aac41' 
  AND (
    token = 'IT6ClyDoBWI2WIdb56c7tJ6ZQ/JBLty5YV+EUAtbH7s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026