UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uNPy2hSNx1BJ9SbCP3eifHpQ7XKkDeaHb5JVMDQ3wHs=' 
WHERE 
  key_id = '8211d3bbae59e09829cda843b279eccb42fd0893a8794c14a4a6e551f9eeaf03' 
  AND (
    token = 'uNPy2hSNx1BJ9SbCP3eifHpQ7XKkDeaHb5JVMDQ3wHs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041