UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8ZwgPsaUvirMSpM2qClheRrQbAm5dywwzVRoBrYkEhY=' 
WHERE 
  key_id = 'e1b80855ca3b875d36270c9e6f9b49deb02c046906c0f14ae76429186f5825fa' 
  AND (
    token = '8ZwgPsaUvirMSpM2qClheRrQbAm5dywwzVRoBrYkEhY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037