UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OUHk5Gskgs0jYd1Q8azvuB7JMD4+yl3Qwgi1iI9n5DY=' 
WHERE 
  key_id = '44271d2adb8fc51ca8662ef28801891a5183cab4ff7f2d0543700576542c9098' 
  AND (
    token = 'OUHk5Gskgs0jYd1Q8azvuB7JMD4+yl3Qwgi1iI9n5DY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016