UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/VsChMBkOhlvk2rDRVSWCwMFWIfD5PQvGOq2gnyqjsg=' 
WHERE 
  key_id = '8c0d78b90c4e9366f39d40a953c95a7d72573a0a8fd8842d32808a31eaeb4950' 
  AND (
    token = '/VsChMBkOhlvk2rDRVSWCwMFWIfD5PQvGOq2gnyqjsg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034