UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't/MCZj61fiDVjBNgZ5/xOpR/ItZU2VC6ZVhhojoy0PA=' 
WHERE 
  key_id = '638fe0f664c93390e4bb618d7a2b429274cf41fa5658fd77a72bd2fd03cba26e' 
  AND (
    token = 't/MCZj61fiDVjBNgZ5/xOpR/ItZU2VC6ZVhhojoy0PA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049