UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'daJ2nIgTdRi0n5uMpcRI9TBWg2qkumN1uD8pYqh5l2s=' 
WHERE 
  key_id = '3b9b56f3d9cae40a23f7c25e8a2e2bc1ce21c9f7efd8a4e73e22a204ae1ec637' 
  AND (
    token = 'daJ2nIgTdRi0n5uMpcRI9TBWg2qkumN1uD8pYqh5l2s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031