UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tjFtfaxAINqOXYhQ0nsmR+G4xJ0bsvHKoX1fpVHA5p4=' 
WHERE 
  key_id = '430c21968162b6fe673b5a7b2ec7d89368205b1d417df22919524add2e9fbe20' 
  AND (
    token = 'tjFtfaxAINqOXYhQ0nsmR+G4xJ0bsvHKoX1fpVHA5p4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018