UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nBlNjVNjVfFFjWo7fLYAY5yeTu9JItJ5bvTf6HJeZxA=' 
WHERE 
  key_id = '78a30049b15251909bba2b2167c1b6136ccd25fc56cdf034f885d0fafff2d4dc' 
  AND (
    token = 'nBlNjVNjVfFFjWo7fLYAY5yeTu9JItJ5bvTf6HJeZxA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018