UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p6frv0As3aAd2LruRkJOBPuyXFPBrfzSZYs8BU9msDM=' 
WHERE 
  key_id = 'f5f3ef6ce3db81c501913e0a752c315d4de53e15bbf716d2dce075cac622dd4f' 
  AND (
    token = 'p6frv0As3aAd2LruRkJOBPuyXFPBrfzSZYs8BU9msDM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016