UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Mk8emoJYKsJF4GY4409gNtHbdX5VlPFpeFcCrfNzbZw=' 
WHERE 
  key_id = 'f375a3ee2e80d05b0cd15b02aba09714174c179f14ff875b7e584cdaef4246ea' 
  AND (
    token = 'Mk8emoJYKsJF4GY4409gNtHbdX5VlPFpeFcCrfNzbZw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015