UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1RojBRkT8KCEb03DUuvnECMp44ST1oTKksFRzPYXnzk=' 
WHERE 
  key_id = '907bd5d9392d9576135b91f7da38460ea037810a754053890ce95fad3046f63c' 
  AND (
    token = '1RojBRkT8KCEb03DUuvnECMp44ST1oTKksFRzPYXnzk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058