UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GXkTU+Fc6Z1Tha2yDNf1kKy1NutDE72MMKb6A9aonjA=' 
WHERE 
  key_id = '6cda469359f562ee2da147a5036d72b813dcf10e007787a61261fc1bc13da526' 
  AND (
    token = 'GXkTU+Fc6Z1Tha2yDNf1kKy1NutDE72MMKb6A9aonjA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034