UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nBXtJvF6/9Ms//+E1iK0trwJxK5G8SUAfBs/ZFkT0qY=' 
WHERE 
  key_id = '60a4e50aece845ad36121600c6e4264cf581bb220e8148d1f92ce4f9d7a89ac3' 
  AND (
    token = 'nBXtJvF6/9Ms//+E1iK0trwJxK5G8SUAfBs/ZFkT0qY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031