UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OaMV6eCRVUxFVvB9gPnefkCwGrVZiiZZvnn8TE1kn8A=' 
WHERE 
  key_id = '9a01248e558a5dcb31bd86b1508bcde43fbacd4ccdfc1c380eb8a6305cb6d2fc' 
  AND (
    token = 'OaMV6eCRVUxFVvB9gPnefkCwGrVZiiZZvnn8TE1kn8A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022