UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VApQX+6nc+8VSGRrrareybtAnyjVWL7gMi7Elf8wbQo=' 
WHERE 
  key_id = '836dc594dfca8cdfe07f81cdacf579ca323800e81f9e250624a622120e24c54e' 
  AND (
    token = 'VApQX+6nc+8VSGRrrareybtAnyjVWL7gMi7Elf8wbQo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032