UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tVgDsFWm5LDpVYnyVy4SUjcBwM3tTKSTg5g4kFIFObI=' 
WHERE 
  key_id = '68a93505dc2821fa53873660657879188b4e8db134f2b3e60477c25ffa49e30d' 
  AND (
    token = 'tVgDsFWm5LDpVYnyVy4SUjcBwM3tTKSTg5g4kFIFObI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043