UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ssknqwZL7r6+Z8cJKvHLgvYvP3IY1FXk65GxE8ZFXUE=' 
WHERE 
  key_id = 'c56de0f141cb07854f0f9f27b983a2ceeb23e33ed9d54e44719b116d018169f6' 
  AND (
    token = 'ssknqwZL7r6+Z8cJKvHLgvYvP3IY1FXk65GxE8ZFXUE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029