UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Nhp2sm0/Brgla27oVzL4R/+lo//bvUERm8M2QfWMrb8=' 
WHERE 
  key_id = 'cf631c885d4b6eabee6a781ea0f40d297f896afbdbbf15fcf2865584852ee15f' 
  AND (
    token = 'Nhp2sm0/Brgla27oVzL4R/+lo//bvUERm8M2QfWMrb8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027