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

Query time 0.00027