UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jel9fPNabnzrPC1A33OhXEaCVX9YXLo7Xdkap0F95yA=' 
WHERE 
  key_id = '139a75ff63fc0ef759f02fc6ce4b37a5390956a22b35808478c1c64d0e2dba3d' 
  AND (
    token = 'jel9fPNabnzrPC1A33OhXEaCVX9YXLo7Xdkap0F95yA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036