UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5QslZLJ0F9xbGW0+O7rtPXGtgJ/fQYr1O0WeLyiFtcI=' 
WHERE 
  key_id = 'c15802914e5205932c65ba781945da8c8fb99926e2fa364733acb4b316312d4b' 
  AND (
    token = '5QslZLJ0F9xbGW0+O7rtPXGtgJ/fQYr1O0WeLyiFtcI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039