UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OixjaQIYJMh7byPK7H5X4eWfxaExqBaABLbzBDdVq0o=' 
WHERE 
  key_id = 'e26da6d650fca4e2fb85cf925d637ef54667e32f89c5b75215acd3361f9c0a60' 
  AND (
    token = 'OixjaQIYJMh7byPK7H5X4eWfxaExqBaABLbzBDdVq0o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028