UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J2IPIl4C4RIPh69BnPNYruCptTbb0EpMsRvVk32NxQo=' 
WHERE 
  key_id = '7a9e137d2d802a47816209c8a8ee4d75c5a5ed44ae3d2803df9b4dfbea0b5bb3' 
  AND (
    token = 'J2IPIl4C4RIPh69BnPNYruCptTbb0EpMsRvVk32NxQo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033