UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qvK/I1ltQEbwyOtmCy2envwld3FlMUM0ByxNKATqv5c=' 
WHERE 
  key_id = '7c8ae0104db68e7af80668c3ee9471532ee4d397745022f43a815f90e0bf288c' 
  AND (
    token = 'qvK/I1ltQEbwyOtmCy2envwld3FlMUM0ByxNKATqv5c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00072