UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7/GrWqmAkJSkC3BmA0j2EoUU3/GrNRSmM7U2sHYWEWg=' 
WHERE 
  key_id = '1aa0a0feaba83020ed5d55f698c132fc09beb9a532ba6a38c632a7551b22745f' 
  AND (
    token = '7/GrWqmAkJSkC3BmA0j2EoUU3/GrNRSmM7U2sHYWEWg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021